package org.bw.bookstore.book.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.bw.bookstore.book.service.impl.InventoryRecordServiceImpl;
import org.bw.bookstore.common.entity.TbInventoryRecord;
import org.bw.bookstore.common.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 *@program:wisdom_bookstore
 *@description:盘点记录控制层
 *@author:孙冬雪
 *@create:2020-10-22 09:50
 */
@RestController
@CrossOrigin
@Slf4j
@Api(tags = "接口-盘点记录管理")
public class InventoryRecordController {

    @Autowired
    private InventoryRecordServiceImpl inventoryRecordService;

    /**
     * @Description
     * TODO 孙冬雪--> makeInventoryRecord 生成盘点清单
     * @Param [inventoryRecord]
     * @Return com.bw.common.utils.ResponseResult
     * @Author 孙冬雪
     * @Date 2020/10/22 10:54
     **/
    @PostMapping("/makeInventoryRecord")
    @ApiOperation(value="生成盘点记录", notes="生成盘点记录")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "inventoryNum", value = "实际盘点数量",dataType = "Integer",required = true),
            @ApiImplicitParam(name = "inventoryTaskCode", value = "盘点任务标识",dataType = "String",required = true),
            @ApiImplicitParam(name = "staffMemberCode", value = "工作人员标识",dataType = "String",required = true)
    })
    public ResponseResult makeInventoryRecord(@ApiIgnore TbInventoryRecord inventoryRecord){
        return inventoryRecordService.makeInventoryRecord(inventoryRecord);
    }

    /**
     * @Description 
     * TODO 孙冬雪--> findInventoryRecordList 查看盘点清单
     * @Param [] 
     * @Return com.bw.common.utils.ResponseResult
     * @Author 孙冬雪
     * @Date 2020/10/22 10:55
     **/
    @PostMapping("/findInventoryRecordList")
    @ApiOperation(value="查询所有盘点记录", notes="查询所有盘点记录")
    public ResponseResult findInventoryRecordList() {
        return inventoryRecordService.findInventoryRecordList();
    }
}
